class Scence1 extends Scence {
	public constructor() {
		super();
	}
	protected OnAdd() {
		this.init();
	}
	private music: egret.Sound;
	private musicChannel: egret.SoundChannel;
	private init() {
		let jx1:egret.TextField=new egret.TextField();
        jx1.text="第一个界面";
        jx1.border=true;
        jx1.borderColor=0xff0000;
        jx1.width=400;
        jx1.height=50;
        jx1.size=50;
        jx1.x=150;
        jx1.y=200;
        this.addChild(jx1);

		let jx2:egret.TextField=new egret.TextField();
        jx2.text="跳到第二个界面";
        jx2.border=true;
        jx2.borderColor=0xff0000;
        jx2.width=400;
        jx2.height=50;
        jx2.size=50;
        jx2.x=120;
        jx2.y=400;
        this.addChild(jx2);
        jx2.touchEnabled=true;
        jx2.addEventListener(egret.TouchEvent.TOUCH_TAP,this.myfunction2,this)
        
        
        let jx3:egret.TextField=new egret.TextField();
        jx3.text="跳到第三个界面";
        jx3.border=true;
        jx3.borderColor=0xff0000;
        jx3.width=400;
        jx3.height=50;
        jx3.size=50;
        jx3.x=120;
        jx3.y=600;
        this.addChild(jx3);
        jx3.touchEnabled=true;
        jx3.addEventListener(egret.TouchEvent.TOUCH_TAP,this.myfunction3,this)
       

		let music: egret.Sound = new egret.Sound();
		music.load('resource/music1.mp3');
		this.music = music;
		this.music.addEventListener(egret.Event.COMPLETE, this.myfunction, this)
	}
	private myfunction() {
		this.musicChannel = this.music.play(0, 0);
	}
	private  myfunction2(){
		this.musicChannel.stop();

        let s2:Scence2 = new Scence2();
        Guanli_Scence.get().changeScene(s2);
        }
	private myfunction3(){
		this.musicChannel.stop();
        let s3:Scence3 = new Scence3();
         Guanli_Scence.get().changeScene(s3);
        }	

	protected OnRem() {

	}


}